package com.lingkang.flychat.mapper.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.lingkang.flychat.entity.User;
import com.lingkang.flychat.entity.MessageList;

import com.lingkang.flychat.mapper.gen.UserDao;
import com.lingkang.flychat.mapper.gen.MessageListDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDaoConfig;
    private final DaoConfig messageListDaoConfig;

    private final UserDao userDao;
    private final MessageListDao messageListDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        messageListDaoConfig = daoConfigMap.get(MessageListDao.class).clone();
        messageListDaoConfig.initIdentityScope(type);

        userDao = new UserDao(userDaoConfig, this);
        messageListDao = new MessageListDao(messageListDaoConfig, this);

        registerDao(User.class, userDao);
        registerDao(MessageList.class, messageListDao);
    }
    
    public void clear() {
        userDaoConfig.clearIdentityScope();
        messageListDaoConfig.clearIdentityScope();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public MessageListDao getMessageListDao() {
        return messageListDao;
    }

}
